package com.way.demo.sort;

/**
 * @author lipingwei
 * @create 2023-03-09 21:52
 */
public class MegeSort {
    public static void main(String[] args) {
        //合并两个无序数组为一个有序数组
        int[] arr1={3,2,8,5,8};
        int[] arr2={1,45,0,7,6};


    }

    public static void sort(int left1,int right1,int left2,int right2, int[] tmp,int[]arr1,int[] arr2){
        int i=left1;
        int j=left1;
        int t=0;
        while (i<=right1 && j<=right2){
            if(arr1[i]<=arr2[j]){
                tmp[t]=arr1[i];
                t++;
                i++;
            }else {
                tmp[t]=arr2[j];
                t++;
                j++;
            }
        }


    }

}
